package com.zhx.mybatislog.user.dao;


import com.zhx.mybatislog.user.entity.ModifyRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author YangJinChuan
 * @since 2021-05-02
 */
@Mapper
public interface ModifyRecordMapper {
    @Insert("INSERT into modify_record(table_name,\n" +
            "column_name,\n" +
            "modify_type,\n" +
            "modify_before,\n" +
            "modify_after,\n" +
            "modify_by\n" +
            ") VALUES(#{tableName},\n" +
            "#{columnName},\n" +
            "#{modifyType},\n" +
            "#{modifyBefore},\n" +
            "#{modifyAfter},\n" +
            "#{modifyBy}\n" +
            ")")
        int saveModifyRecord(ModifyRecord modifyRecord);

    @Select("Select * from Modify_record")
    List<ModifyRecord> getAll();
}
